package com.taotao.template.imple;

import com.taotao.template.DistributedLockTemplate;
import org.springframework.stereotype.Component;

/**
 * @author wangjin
 * @title: RedisDistrbutedLockTemplate
 * @projectName designmodule
 * @description: TODO
 * @date 2022/6/18 0018 17:10
 */
@Component
public class RedisDistrbutedLockTemplate  extends DistributedLockTemplate {
    @Override
    protected void tryLock() {
           try {
               Thread.sleep(10);
           }catch (Exception e){

           }
        System.out.println("redis获取分布式锁");
    }

    @Override
    protected void tryunlock() {
        try {
            Thread.sleep(10);
        }catch (Exception e){

        }
        System.out.println("redis释放分布式锁");
    }
}
